import type { AxiosInstance, AxiosRequestConfig } from 'axios';
import { BASE_URL } from './http/config';
import httpClient from '@/apis/http/http-client';

export default class ApiBase {
  protected httpClient: AxiosInstance = httpClient;
  protected config?: AxiosRequestConfig;
  constructor(axiosInstance?: AxiosInstance, config?: AxiosRequestConfig) {
    this.config = {
      baseURL: BASE_URL,
      ...config
    };
    if (axiosInstance !== undefined) {
      this.httpClient = httpClient;
    }
  }
}
